﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Farigola.Engine.PersistXml
{
    public class ProjectRepositXmlDef
    {
        //=====================================================================
        #region xmlDoc file name

        public static string XmlDocParamsFileName = "Params.xml";
        public static string XmlDocTypesFileName = "Types.xml";
        public static string XmlDocEntityTreeFileName = "EntityTree.xml";

        #endregion

        //=====================================================================
        #region xml element text

        public static string XmlEltRootParams = "Params";
        public static string XmlEltRootTypes = "Types";
        public static string XmlEltRootEntityTree = "EntityTree";

        public static string XmlEltEntity = "Entity";

        public static string XmlEltEntAttribType = "Type";

        public static string XmlEltRev = "Rev";
        public static string XmlEltDateCre = "DateCre";
        
        public static string XmlEltId = "Id";
        public static string XmlEltName = "Name";
        public static string XmlEltSystOrUser = "SystOrUser";

        public static string XmlEltEntInstFolderChilds = "Childs";

        // for string, int
        //public static string XmlEltValue = "Value";
        #endregion

        //=====================================================================
        #region xml element objets: entity , dataValue, process

        public static string XmlEltEntInstFolder = "EntInstFolder";
        public static string XmlEltEntInstString = "EntInstString";
        public static string XmlEltEntInstInt = "EntInstInt";
        public static string XmlEltEntInstDouble = "EntInstDouble";
        public static string XmlEltEntInstBool = "EntInstBool";

        public static string XmlEltEntInstStructList = "EntInstStructList";

        public static string XmlEltEntTypeClass = "EntTypeClass";
        public static string XmlEltEntTypeClassAnonym = "EntTypeClassAnonym";

        public static string XmlEltEntInstClass = "EntInstClass";
        public static string XmlEltEntInstClassAnonym = "EntInstClassAnonym";

        //public static string XmlEltEntDataValue = "dv";
        //public static string XmlEltDataValueIsNull = "IsNull";
        //public static string XmlEltDataValueIsNullable = "IsNullable";
        //public static string XmlEltDataValueValue = "Val";

        #endregion

        //=====================================================================
        #region xml element objets: entity , dataValue, process

        public static string XmlEltDataValue = "dv";

        public static string XmlEltDataValueAttribType = "Type";
        public static string XmlEltDataValueAttribTypeString = "String";
        public static string XmlEltDataValueAttribTypeInt = "Int";
        public static string XmlEltDataValueAttribTypeDouble = "Double";
        public static string XmlEltDataValueAttribTypeBool = "Bool";

        public static string XmlEltDataValueIsNull = "IsNull";
        public static string XmlEltDataValueIsNullable = "IsNullable";
        public static string XmlEltDataValueValue = "Val";

        #endregion

        //=====================================================================
        #region revision number of objects

        // project
        public static string LastRevNumProject = "1";
        
        // entity instance folder
        public static string LastRevNumEntInstFolder = "1";

        public static string LastRevNumEntInstString = "1";
        public static string LastRevNumEntInstInt = "1";
        public static string LastRevNumEntInstDouble = "1";
        public static string LastRevNumEntInstBool = "1";

        public static string LastRevNumEntInstClass = "1";
        public static string LastRevNumEntInstClassAnonym = "1";

        public static string LastRevNumEntTypeClass = "1";

        // need it? todo:
        public static string LastRevNumEntTypeClassAnonym = "1";

        #endregion

        //=====================================================================
        #region others parameters

        public static string dateTimeFormat = "dd/MM/yyyy HH:mm:ss";

        #endregion


        //=====================================================================
        public enum ErrorCode
        {
            FileNotExist,
            CantReadFile,
            FileNameWrong,

            UnableToSaveFile,

            ParamsWrong,
            CantCreateProjectParamsWrong,
            EntityNodeNameExpected,
            EntityAttribTypeWrong,
        
            CantCreateEntInstString,

            XmlEltEntInstStringNodeDVNotFound,
            XmlEltEntInstDVAttribTypeWrong,
            XmlEltEntInstDVAttribIsNullWrong,
            XmlEltEntInstDVAttribIsNullableWrong,
        }
    }
}
